package com.xzy.filter;

import javax.servlet.*;
import java.io.IOException;

public class AllServletFilder implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {

        try {
            chain.doFilter(request,response);

            com.xzy.utils.jdbcUtils.clossAndCommit();
        } catch (Exception e) {
            e.printStackTrace();
            com.xzy.utils.jdbcUtils.clossandBack();

        }
    }

    @Override
    public void destroy() {

    }
}
